package config

import (
	"net"
	"strconv"
	"strings"

	"databasex"

	"github.com/rabbitmq/amqp091-go"
)

// const MqConfigUrl = "amqp://kuteng:kuteng@127.0.0.1:5672"

const (
	User     = "root"
	Password = "root"
	Port     = 5672
	Port2    = 5673
)

var (
	Addr         = net.JoinHostPort(databasex.Host, strconv.Itoa(Port))
	Addr2        = net.JoinHostPort(databasex.Host, strconv.Itoa(Port2))
	MqConfigUrl  = strings.Join([]string{"amqp://", User, ":", Password, "@", Addr, "/"}, "")
	MqConfigUrl2 = strings.Join([]string{"amqp://", User, ":", Password, "@", Addr2, "/"}, "")
)

const (
	routingkey   = "Key"
	queue        = "Queue"
	exchange     = "Exchange"
	WorkQueue    = "Work" + queue
	WorkExchange = "Work" + exchange
	WorkKey      = "/Work" + routingkey
)

var DefaultTable = amqp091.Table{
	amqp091.QueueTypeArg: amqp091.QueueTypeQuorum,
	//amqp091.QueueMessageTTLArg:
}
